package com.evil.application.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.evil.application.mapper.ApplicationInfoMapper;
import com.evil.application.pojo.dto.AppTreeDTO;
import com.evil.application.pojo.dto.ApplicationReqDTO;
import com.evil.application.pojo.entity.ApplicationInfo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 应用表
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
public interface ApplicationInfoService extends IService<ApplicationInfo> {

    @Override
    ApplicationInfoMapper getBaseMapper();

    /**
     * 获取企业并检查企业
     *
     * @param applicationKey applicationKey
     * @return ApplicationInfo
     */
    ApplicationInfo checkByKey(String applicationKey);

    /**
     * 检查应用状态
     *
     * @param applicationInfo applicationInfo
     */
    void checkApplication(ApplicationInfo applicationInfo);

    /**
     * 检查应用申请状态
     *
     * @param applicationInfo applicationInfo
     */
    void checkApplyApplication(ApplicationInfo applicationInfo);

    /**
     * 删除应用
     *
     * @param id id
     */
    void deleteById(Long id);

    /**
     * 删除应用
     *
     * @param applicationInfo applicationInfo
     */
    void delete(ApplicationInfo applicationInfo);

    /**
     * 应用树
     *
     * @param applicationReqDTO applicationReqDTO
     */
    List<AppTreeDTO> applicationTree(@Validated @RequestBody ApplicationReqDTO applicationReqDTO);
}
